Carriage Returns

Is there a built in feature (function) within DXL that removes all ending carraige returns within a string (Object Tex). I'm trying to remove all ending carriage returns. I am assuming reg expressions would do the job.

text\n\r
test\n\r
text\n\r\n\r <- I just want to remove the end ones wich may very.

-Jim
SystemAdmin - Thu Feb 09 15:56:47 EST 2012

Re: Carriage Returns
rmoskwa - Thu Feb 09 17:09:41 EST 2012

Hi Jim,

I am not sure if this discussion will help
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=415194
It discusses a trim function that was used to remove trailing spaces and newlines at the end of text.

Re: Carriage Returns
llandale - Fri Feb 10 11:46:08 EST 2012

For whatever its worth, this is what I've determined to be "White Space Characters", which I think are subject to "trimming":

// cl_White: define those characters that qualify as 'white' space.
        // Note: In DXL Manual, function isspace() says these are spaces: ' ', \t, \n, \m, \j, \k.
                //      However: \m, \j, and \k are illegal character constants.
                //      Proven by DXL (test PrintAsciiCodes.dxl), isspace() thinks these are white: 
                //              ' ', \t, \n, \v, \f, \r.
                //      Additionally, we want ascii code 160 to be white space, its an
                //              MS-Word non-breaking space.
                // Some other characters print OK, but MS-Word interprets as commands, e.g. page break.
 
string  cl_White        = " \t\n\v\f\r" charOf(160) ""      // White Space. see above comments.


Thus perhaps you want to trim "White Space".

-Louie